package cn.zqy.demo2.day14FoundationStrengthening.Domain;

public class Person {
    private String name;
    private int age;

    public String a;
    protected String b;
    String c;
    private String d;

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    // Demo03添加私有构造
    private Person(String name, String a) {
        this.name = name;
        this.a = a;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    // Demo04新增方法
    public void eat() {
        System.out.println("在吃...");
    }
    private void eat(String food) {
        System.out.println("在吃..." + food);
    }
}
